// pages/make/over/over.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  console.log(options)
	this.setData({
		data:options
	})
  },
  iphone(){
	  wx.makePhoneCall({
		phoneNumber:this.data.data.mobile
	  })
  },
  onGuideTap: function() {
	  console.log(this.data.data.lat+'==='+this.data.data.lon+'==='+this.data.data.name)
  	var lat =this.data.data.lat;
  	var lon = this.data.data.lon;
  	var bankName =  this.data.data.name;
  	 let x_pi = (3.14159265358979324 * 3000.0) / 180.0;
  	    let x = lon - 0.0065;
  	    let y = lat - 0.006;
  	    let z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
  	    let theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
  	    let lngs = z * Math.cos(theta);
  	    let lats = z * Math.sin(theta);
  	console.log(lat);
  	console.log(lon);
  	wx.openLocation({
  		type: 'gcj02',
  		latitude: lats,
  		longitude: lngs,
  		name: bankName,
  		scale: 27
  	})
  },
  onUnload(){
	  wx.switchTab({
		  url:'../../index/index'
	  })
  }
})